package datastruct;

import java.util.Vector;

public class Tables {
	private Vector<Table> tables = new Vector<Table>();

	public Tables()
	{
		super();
	}
	
	public void addTable(Table table)
	{
		this.tables.add(table);
	}
	
	public Table get(String tableName)
	{
		
		System.out.println("IN CERCA DI " + tableName);
		for (int i=0;i<tables.size();i++)
		{
			String tblName = tables.get(i).getName(); 
			System.out.println("tabella corrente:" + tblName);
			if(tblName.equalsIgnoreCase(tableName))
				return tables.get(i);
		}
		return null;
	}
	
	public Table get(int index)
	{
		return this.tables.get(index);
	}
	
	public Table getTables(int index)
	{
		return this.tables.get(index);
	}
	
	public int size()
	{
		return tables.size();
	}
}
